package mall

import (
	"e_mall_server/service"
	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
	"strconv"
)

/**
 * @Author: zhaobin
 * @Description TODO
 * @Date: 2022-05-16 22:55
 */

// GetGoodsImageListByGoodsId 通过商品id查询图片信息查询
func GetGoodsImageListByGoodsId(c *gin.Context) {
	idStr := c.Param("id")
	id, err := strconv.ParseInt(idStr, 10, 64)
	if err != nil {
		zap.L().Error("GetGoodsImageListByGoodsId with invalid param", zap.Error(err))
		ResponseError(c, "请求参数错误")
	}
	goodsImageList := service.GetGoodsImageListByGoodsId(id)
	ResponseSuccess(c, goodsImageList)
}
